package org.jeecg.modules.demo.publicplace.service;

import org.jeecg.modules.demo.publicplace.entity.ZnzfMyPublicApplyAndStateParam;
import org.jeecg.modules.demo.publicplace.entity.ZnzfMyPublicApplyParam;
import org.jeecg.modules.demo.publicplace.entity.ZnzfPublicApply;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * @Description: 公共场所预约
 * @Author: jeecg-boot
 * @Date:   2022-04-11
 * @Version: V1.0
 */
public interface IZnzfPublicApplyService extends IService<ZnzfPublicApply> {

    /**
     * 根据eid查询用户所属项目下所有公共场所类型
     * @param eid
     * @return
     */
    List<Integer> queryAllPublicTypeByEid(String eid);


    /**
     * 插入一条预约记录
     * @param publicId
     * @param publicOpenId
     * @param eid
     * @param applyNumber
     * @return
     */
    void insertPublicApply(String publicId, String publicOpenId, String eid, int applyNumber);

    /**
     * 根据id查询预约表项
     * @param id
     * @return
     */
    ZnzfPublicApply queryPublicApplyById(String id);

    /**
     * 根据id查询eid
     * @param id
     * @return
     */
    String queryEidById(String id);

    /**
     * 根据预约表id取消预约
     * @param publicApplyId
     * @return
     */
    int cancelReservation(String publicApplyId);

    /**
     * 通过userId查询我的预约信息
     * @param userId
     * @return
     */
    List<ZnzfMyPublicApplyAndStateParam> getByUserId(String userId);
}
